home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1995.rar / 1995 / AUG / RP9508 / btnbar.pas < prev    next >
Pascal/Delphi Source File  |  1995-04-03  |  3KB  |  110 lines

  1. unit Btnbar;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls;
  8.  
  9. type
  10.   TBtnBarWin = class(TForm)
  11.     SBInsurance: TSpeedButton;
  12.     SBBenefits: TSpeedButton;
  13.     SBPolicies: TSpeedButton;
  14.     SBBack: TSpeedButton;
  15.     BBtnExit: TBitBtn;
  16.     PnlInsurance: TPanel;
  17.     SBMedIns: TSpeedButton;
  18.     SBDentIns: TSpeedButton;
  19.     SBVisIns: TSpeedButton;
  20.     SBLifeIns: TSpeedButton;
  21.     procedure SBBackClick(Sender: TObject);
  22.     procedure SBInsuranceClick(Sender: TObject);
  23.     procedure BBtnExitClick(Sender: TObject);
  24.     procedure SBBenefitsClick(Sender: TObject);
  25.     procedure SBPoliciesClick(Sender: TObject);
  26.     procedure SBMedInsClick(Sender: TObject);
  27.     procedure SBDentInsClick(Sender: TObject);
  28.     procedure SBVisInsClick(Sender: TObject);
  29.     procedure SBLifeInsClick(Sender: TObject);
  30.   private
  31.     { Private declarations }
  32.   public
  33.     { Public declarations }
  34.   end;
  35.  
  36. var
  37.   BtnBarWin: TBtnBarWin;
  38.  
  39. implementation
  40.  
  41. {$R *.DFM}
  42. uses
  43. mainfrm;
  44. procedure TBtnBarWin.SBBackClick(Sender: TObject);
  45. {Close 2ndary window & redisplay main window}
  46. begin
  47. BtnBarWin.Hide;
  48. MainWin.Show;
  49. Application.HelpCommand(HELP_QUIT, 0);    {Close any open Help file}
  50. end;
  51.  
  52. procedure TBtnBarWin.SBInsuranceClick(Sender: TObject);
  53. {User has selected Insurance button in main screen}
  54. begin
  55. SBInsurance.Down := True;                   {Display Speedbutton in down state}
  56. Application.HelpFile := 'INSURE.HLP';       {Set current Help file}
  57. Application.HelpCommand(HELP_CONTENTS, 0);  {Access Help file Contents}
  58. PnlInsurance.visible := True;               {Display button panel}
  59. end;
  60.  
  61. procedure TBtnBarWin.BBtnExitClick(Sender: TObject);
  62. {Quits the aplication from the 2ndary window}
  63. begin
  64. Application.HelpCommand(HELP_QUIT, 0);     {Shut down WinHelp}
  65. BtnBarWin.Close;                           {Close app windows}
  66. MainWin.Close;
  67. end;
  68.  
  69. procedure TBtnBarWin.SBBenefitsClick(Sender: TObject);
  70. begin
  71. SBBenefits.Down := True;
  72. Application.HelpFile := 'BENEFITS.HLP';
  73. Application.HelpCommand(HELP_CONTENTS, 0);
  74. If PnlInsurance.Visible = True then          {Hide Insurance topic panel}
  75.    PnlInsurance.Visible := False;
  76. end;
  77.  
  78. procedure TBtnBarWin.SBPoliciesClick(Sender: TObject);
  79. begin
  80. SBPolicies.Down := True;
  81. Application.HelpFile := 'POLICIES.HLP';
  82. Application.HelpCommand(HELP_CONTENTS, 0);
  83. If PnlInsurance.Visible = True then
  84.    PnlInsurance.Visible := False;
  85. end;
  86.  
  87. {These event handlers access a specific topic in the current Help file by
  88.  referencing the Context String as specified in the Help source file.}
  89. procedure TBtnBarWin.SBMedInsClick(Sender: TObject);
  90. begin
  91. Application.HelpJump('MEDICALPLAN');
  92. end;
  93.  
  94. procedure TBtnBarWin.SBDentInsClick(Sender: TObject);
  95. begin
  96. Application.HelpJump('DENTALPLAN')
  97. end;
  98.  
  99. procedure TBtnBarWin.SBVisInsClick(Sender: TObject);
  100. begin
  101. Application.HelpJump('VISIONPLAN')
  102. end;
  103.  
  104. procedure TBtnBarWin.SBLifeInsClick(Sender: TObject);
  105. begin
  106. Application.HelpJump('LIFEPLAN');
  107. end;
  108.  
  109. end.
  110.